﻿@using PSU.Model.Areas
@{
    ViewData["Title"] = "宿舍楼信息";
    ViewData["NavTitle"] = "宿舍信息管理";
    ViewData["CurrName"] = "基础信息维护";
}

<section class="content-header">
    <h1>
        基础信息维护
        <small>Building Information</small>
    </h1>
    <ol class="breadcrumb">
        <li>
            <a asp-area="Administrator" asp-controller="Home" asp-action="Index">
                <i class="fa fa-dashboard"></i> 首页
            </a>
        </li>
        <li>宿舍信息</li>
        <li class="active">基础信息维护</li>
    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="form-group col-md-3">
                <label class="control-label no-padding-right col-md-5 col-xs-4" for="code">编号：</label>
                <div class="input-group col-md-7 col-xs-8">
                    <input id="code" type="text" class="form-control">
                    <div class="input-group-addon">
                        <i class="fa fa-building"></i>
                    </div>
                </div>
            </div>
            <div class="form-group col-md-3">
                <label class="control-label no-padding-right col-md-5 col-xs-4" for="type">建筑类型：</label>
                <div class="input-group col-md-7 col-xs-8">
                    <select id="type" name="" class="form-control">
                        <option value="0">请选择</option>
                        <option value="1">男生寝室</option>
                        <option value="2">女生寝室</option>
                        <option value="3">混合寝室</option>
                    </select>
                </div>
            </div>
            <div class="form-group col-md-3">
                <label class="control-label no-padding-right col-md-5 col-xs-4" for="enable">是否启用：</label>
                <div class="input-group col-md-7 col-xs-8">
                    <select id="enable" name="" class="form-control">
                        <option value="9">请选择</option>
                        <option value="1">启用</option>
                        <option value="0">未启用</option>
                    </select>
                </div>
            </div>
            <div class="form-group col-md-3">
                <button id="search" class="btn btn-dropbox btn-flat col-md-4">
                    <i class="fa fa-search"></i>&nbsp;搜索
                </button>
                <button data-toggle="modal" data-target="#myModal" class="btn btn-success btn-flat col-md-4 col-xs-offset-1 col-md-offset-1">
                    <i class="fa fa-plus"></i>&nbsp;新建
                </button>
            </div>
        </div>
    </div>
    <div class="row">
        @await Html.PartialAsync("_BuildingTablePartial")
    </div>

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="modalLabel">编辑宿舍信息</h5>
                </div>
                <div class="modal-body">
                    <input type="hidden" id="edit_id" value=""/>
                    <form method="post" class="form-horizontal" role="form">
                        <div class="form-group">
                            <label class="col-md-3 col-xs-3 control-label no-padding-right" for="edit_name"> 宿舍楼名称： </label>
                            <div class="col-md-3 col-xs-9">
                                <input class="col-md-5 col-xs-12 form-control" id="edit_name" type="text" maxlength="20">
                            </div>
                            <label class="col-md-3 control-label no-padding-right" for="edit_floor">总楼层：</label>
                            <div class="col-md-2">
                                <input class="form-control" id="edit_floor" type="number" min="1">
                            </div>
                            <label class="control-label" for="floor">层</label>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label no-padding-right" for="edit_type">宿舍楼类型：</label>
                            <div class="col-md-3">
                                <select id="edit_type" asp-items="@Html.GetEnumSelectList(typeof(EnumType.BuildingType))" class="form-control"></select>
                            </div>
                            <label class="col-md-3 col-xs-3 control-label no-padding-right" for="edit_enable"> 是否启用： </label>
                            <div class="col-md-3 col-xs-9">
                                <select id="edit_enable" asp-items="@Html.GetEnumSelectList(typeof(EnumType.Enable))" class="form-control"></select>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" id="add">提交更改</button>
                </div>
            </div>
        </div>
    </div>
</section>

@section scripts{
    <environment include="Development">
        <script src="~/javascript/view/Administrator/building.js"></script>
    </environment>
    <environment exclude="Development">
        <script src="~/javascript/view/Administrator/building.min.js" asp-append-version="true"></script>
    </environment>
}